/*
* MATLAB Compiler: 4.11 (R2009b)
* Date: Tue Nov 29 19:07:31 2011
* Arguments: "-B" "macro_default" "-W" "dotnet:HighPass,HighPass,0.0,private" "-d"
* "C:\Users\Nana\Desktop\4th year\First Term\image Processing\Projects\MatlabTasks\Matlab
* Projects\HighPass\src" "-T" "link:lib" "-v" "class{HighPass:C:\Users\Nana\Desktop\4th
* year\First Term\image Processing\Projects\MatlabTasks\Functions\High
* pass\ButterworthHighPass.m,C:\Users\Nana\Desktop\4th year\First Term\image
* Processing\Projects\MatlabTasks\Functions\High
* pass\GaussianHighPass.m,C:\Users\Nana\Desktop\4th year\First Term\image
* Processing\Projects\MatlabTasks\Functions\High pass\IdealHighPass.m}" 
*/
using System;
using System.Reflection;
using System.IO;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using MathWorks.MATLAB.NET.ComponentData;

#if SHARED
[assembly: System.Reflection.AssemblyKeyFile(@"")]
#endif

namespace HighPassNative
{
  /// <summary>
  /// The HighPass class provides a CLS compliant, Object (native) interface to the
  /// M-functions contained in the files:
  /// <newpara></newpara>
  /// C:\Users\Nana\Desktop\4th year\First Term\image
  /// Processing\Projects\MatlabTasks\Functions\High pass\ButterworthHighPass.m
  /// <newpara></newpara>
  /// C:\Users\Nana\Desktop\4th year\First Term\image
  /// Processing\Projects\MatlabTasks\Functions\High pass\GaussianHighPass.m
  /// <newpara></newpara>
  /// C:\Users\Nana\Desktop\4th year\First Term\image
  /// Processing\Projects\MatlabTasks\Functions\High pass\IdealHighPass.m
  /// <newpara></newpara>
  /// deployprint.m
  /// <newpara></newpara>
  /// printdlg.m
  /// </summary>
  /// <remarks>
  /// @Version 0.0
  /// </remarks>
  public class HighPass : IDisposable
  {
    #region Constructors

    /// <summary internal= "true">
    /// The static constructor instantiates and initializes the MATLAB Component Runtime
    /// instance.
    /// </summary>
    static HighPass()
    {
      if (MWMCR.MCRAppInitialized)
      {
        Assembly assembly= Assembly.GetExecutingAssembly();

        string ctfFilePath= assembly.Location;

        int lastDelimiter= ctfFilePath.LastIndexOf(@"\");

        ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter));

        string ctfFileName = MCRComponentState.MCC_HighPass_name_data + ".ctf";

        Stream embeddedCtfStream = null;

        String[] resourceStrings = assembly.GetManifestResourceNames();

        foreach (String name in resourceStrings)
        {
          if (name.Contains(ctfFileName))
          {
            embeddedCtfStream = assembly.GetManifestResourceStream(name);
            break;
          }
        }
        mcr= new MWMCR(MCRComponentState.MCC_HighPass_name_data,
                       MCRComponentState.MCC_HighPass_root_data,
                       MCRComponentState.MCC_HighPass_public_data,
                       MCRComponentState.MCC_HighPass_session_data,
                       MCRComponentState.MCC_HighPass_matlabpath_data,
                       MCRComponentState.MCC_HighPass_classpath_data,
                       MCRComponentState.MCC_HighPass_libpath_data,
                       MCRComponentState.MCC_HighPass_mcr_application_options,
                       MCRComponentState.MCC_HighPass_mcr_runtime_options,
                       MCRComponentState.MCC_HighPass_mcr_pref_dir,
                       MCRComponentState.MCC_HighPass_set_warning_state,
                       ctfFilePath, embeddedCtfStream, true);
      }
      else
      {
        throw new ApplicationException("MWArray assembly could not be initialized");
      }
    }


    /// <summary>
    /// Constructs a new instance of the HighPass class.
    /// </summary>
    public HighPass()
    {
    }


    #endregion Constructors

    #region Finalize

    /// <summary internal= "true">
    /// Class destructor called by the CLR garbage collector.
    /// </summary>
    ~HighPass()
    {
      Dispose(false);
    }


    /// <summary>
    /// Frees the native resources associated with this object
    /// </summary>
    public void Dispose()
    {
      Dispose(true);

      GC.SuppressFinalize(this);
    }


    /// <summary internal= "true">
    /// Internal dispose function
    /// </summary>
    protected virtual void Dispose(bool disposing)
    {
      if (!disposed)
      {
        disposed= true;

        if (disposing)
        {
          // Free managed resources;
        }

        // Free native resources
      }
    }


    #endregion Finalize

    #region Methods

    /// <summary>
    /// Provides a single output, 0-input Objectinterface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object ButterworthHighPass()
    {
      return mcr.EvaluateFunction("ButterworthHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides a single output, 1-input Objectinterface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="N">Input argument #1</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object ButterworthHighPass(Object N)
    {
      return mcr.EvaluateFunction("ButterworthHighPass", N);
    }


    /// <summary>
    /// Provides a single output, 2-input Objectinterface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object ButterworthHighPass(Object N, Object realImg)
    {
      return mcr.EvaluateFunction("ButterworthHighPass", N, realImg);
    }


    /// <summary>
    /// Provides a single output, 3-input Objectinterface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <param name="imagImg">Input argument #3</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object ButterworthHighPass(Object N, Object realImg, Object imagImg)
    {
      return mcr.EvaluateFunction("ButterworthHighPass", N, realImg, imagImg);
    }


    /// <summary>
    /// Provides a single output, 4-input Objectinterface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <param name="imagImg">Input argument #3</param>
    /// <param name="D0">Input argument #4</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object ButterworthHighPass(Object N, Object realImg, Object imagImg, Object D0)
    {
      return mcr.EvaluateFunction("ButterworthHighPass", N, realImg, imagImg, D0);
    }


    /// <summary>
    /// Provides the standard 0-input Object interface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] ButterworthHighPass(int numArgsOut)
    {
      return mcr.EvaluateFunction(numArgsOut, "ButterworthHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides the standard 1-input Object interface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="N">Input argument #1</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] ButterworthHighPass(int numArgsOut, Object N)
    {
      return mcr.EvaluateFunction(numArgsOut, "ButterworthHighPass", N);
    }


    /// <summary>
    /// Provides the standard 2-input Object interface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] ButterworthHighPass(int numArgsOut, Object N, Object realImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "ButterworthHighPass", N, realImg);
    }


    /// <summary>
    /// Provides the standard 3-input Object interface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <param name="imagImg">Input argument #3</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] ButterworthHighPass(int numArgsOut, Object N, Object realImg, Object 
                                  imagImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "ButterworthHighPass", N, realImg, imagImg);
    }


    /// <summary>
    /// Provides the standard 4-input Object interface to the ButterworthHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="N">Input argument #1</param>
    /// <param name="realImg">Input argument #2</param>
    /// <param name="imagImg">Input argument #3</param>
    /// <param name="D0">Input argument #4</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] ButterworthHighPass(int numArgsOut, Object N, Object realImg, Object 
                                  imagImg, Object D0)
    {
      return mcr.EvaluateFunction(numArgsOut, "ButterworthHighPass", N, realImg, imagImg, D0);
    }


    /// <summary>
    /// Provides a single output, 0-input Objectinterface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object GaussianHighPass()
    {
      return mcr.EvaluateFunction("GaussianHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides a single output, 1-input Objectinterface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object GaussianHighPass(Object realImg)
    {
      return mcr.EvaluateFunction("GaussianHighPass", realImg);
    }


    /// <summary>
    /// Provides a single output, 2-input Objectinterface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object GaussianHighPass(Object realImg, Object imagImg)
    {
      return mcr.EvaluateFunction("GaussianHighPass", realImg, imagImg);
    }


    /// <summary>
    /// Provides a single output, 3-input Objectinterface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <param name="D0">Input argument #3</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object GaussianHighPass(Object realImg, Object imagImg, Object D0)
    {
      return mcr.EvaluateFunction("GaussianHighPass", realImg, imagImg, D0);
    }


    /// <summary>
    /// Provides the standard 0-input Object interface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] GaussianHighPass(int numArgsOut)
    {
      return mcr.EvaluateFunction(numArgsOut, "GaussianHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides the standard 1-input Object interface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] GaussianHighPass(int numArgsOut, Object realImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "GaussianHighPass", realImg);
    }


    /// <summary>
    /// Provides the standard 2-input Object interface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] GaussianHighPass(int numArgsOut, Object realImg, Object imagImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "GaussianHighPass", realImg, imagImg);
    }


    /// <summary>
    /// Provides the standard 3-input Object interface to the GaussianHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <param name="D0">Input argument #3</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] GaussianHighPass(int numArgsOut, Object realImg, Object imagImg, 
                               Object D0)
    {
      return mcr.EvaluateFunction(numArgsOut, "GaussianHighPass", realImg, imagImg, D0);
    }


    /// <summary>
    /// Provides a single output, 0-input Objectinterface to the IdealHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object IdealHighPass()
    {
      return mcr.EvaluateFunction("IdealHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides a single output, 1-input Objectinterface to the IdealHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object IdealHighPass(Object realImg)
    {
      return mcr.EvaluateFunction("IdealHighPass", realImg);
    }


    /// <summary>
    /// Provides a single output, 2-input Objectinterface to the IdealHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object IdealHighPass(Object realImg, Object imagImg)
    {
      return mcr.EvaluateFunction("IdealHighPass", realImg, imagImg);
    }


    /// <summary>
    /// Provides a single output, 3-input Objectinterface to the IdealHighPass
    /// M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <param name="D0">Input argument #3</param>
    /// <returns>An Object containing the first output argument.</returns>
    ///
    public Object IdealHighPass(Object realImg, Object imagImg, Object D0)
    {
      return mcr.EvaluateFunction("IdealHighPass", realImg, imagImg, D0);
    }


    /// <summary>
    /// Provides the standard 0-input Object interface to the IdealHighPass M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] IdealHighPass(int numArgsOut)
    {
      return mcr.EvaluateFunction(numArgsOut, "IdealHighPass", new Object[]{});
    }


    /// <summary>
    /// Provides the standard 1-input Object interface to the IdealHighPass M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] IdealHighPass(int numArgsOut, Object realImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "IdealHighPass", realImg);
    }


    /// <summary>
    /// Provides the standard 2-input Object interface to the IdealHighPass M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] IdealHighPass(int numArgsOut, Object realImg, Object imagImg)
    {
      return mcr.EvaluateFunction(numArgsOut, "IdealHighPass", realImg, imagImg);
    }


    /// <summary>
    /// Provides the standard 3-input Object interface to the IdealHighPass M-function.
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <param name="numArgsOut">The number of output arguments to return.</param>
    /// <param name="realImg">Input argument #1</param>
    /// <param name="imagImg">Input argument #2</param>
    /// <param name="D0">Input argument #3</param>
    /// <returns>An Array of length "numArgsOut" containing the output
    /// arguments.</returns>
    ///
    public Object[] IdealHighPass(int numArgsOut, Object realImg, Object imagImg, Object 
                            D0)
    {
      return mcr.EvaluateFunction(numArgsOut, "IdealHighPass", realImg, imagImg, D0);
    }


    /// <summary>
    /// This method will cause a MATLAB figure window to behave as a modal dialog box.
    /// The method will not return until all the figure windows associated with this
    /// component have been closed.
    /// </summary>
    /// <remarks>
    /// An application should only call this method when required to keep the
    /// MATLAB figure window from disappearing.  Other techniques, such as calling
    /// Console.ReadLine() from the application should be considered where
    /// possible.</remarks>
    ///
    public void WaitForFiguresToDie()
    {
      mcr.WaitForFiguresToDie();
    }



    #endregion Methods

    #region Class Members

    private static MWMCR mcr= null;

    private bool disposed= false;

    #endregion Class Members
  }
}
